
#ifndef __DATASTORAGE_H
#define __DATASTORAGE_H

#include "gd32f30x.h"
#include <stdbool.h>



enum StoragePos
{
	//******************************FLASH****************************************//
	
	PosFlash_Bootloader_Base_Address = 0x08000000,
	PosFlash_Bootloader_Info_Address = 0x0803E800,
	PosFlash_App_Base_Address = 0x08040000,
	PosFlash_App_Info_Address = 0x0807E800,
	
	PosFlash_App_BackUp_Base_Address = 0x08080000,
	PosFlash_App_BackUp_Info_Address = 0x0808E800,
	
	PosFlash_Global_Info_Address = 0x080C0000,
	
	//******************************GD25Q64****************************************//

	PosGD25Q64_flechazo = 0, //8B
	PosGD25Q64_ProgramVersion = PosGD25Q64_flechazo+8, //4B
	PosGD25Q64_OwnID=PosGD25Q64_ProgramVersion+4, //8B
	
	PosGD25Q64_FunctionalConfiguration=0x0100, //1B
	PosGD25Q64_RemoteControl=PosGD25Q64_FunctionalConfiguration+1, //10B
	
	PosGD25Q64_NumberOfDevice=0x0200, //2B
	PosGD25Q64_DeviceInfo=PosGD25Q64_NumberOfDevice+2, //100 * 11B
	
	PosGD25Q64_IndependentTaskInfo_num_I=0x1000, //2B
	PosGD25Q64_IndependentTaskInfo_Task_I=PosGD25Q64_IndependentTaskInfo_num_I+2,
	
	PosGD25Q64_IndependentTaskInfo_num_G=0x61000,
	PosGD25Q64_IndependentTaskInfo_Task_G=PosGD25Q64_IndependentTaskInfo_num_G+2,
	
	PosGD25Q64_BootloaderInfo=0x81000,
	PosGD25Q64_Bootloader_APP_Run=0x82000,
	PosGD25Q64_Bootloader_APP_Backup=0xA2000,
};





#endif   //__BUFFER_H

